<?php

namespace app\webapi\vms\validate;

use app\webapi\common\BaseValidate;

/**
 * @幻灯片验证类
 */
class SlideValidate extends BaseValidate
{
    //验证规则
    protected $rule = [
        'page_no' => 'require|number',
        'page_size' => 'require|number',
        'cover' => 'url',
        'id' => 'require|number',
        'ids' => 'require',
    ];

    //验证消息
    protected $message = [
        'page_no.require' => '页码必填',
        'page_no.number' => '页码参数必须是整数类型',
        'page_size.require' => '每页显示条目数必填',
        'page_size.number' => '每页显示条目数必须是整数类型',
        'id.require' => '模板id必填',
        'id.number' => '模板id必须是整数类型',
        'ids.require' => 'ids参数必填',
        'cover.url' => '封面图片必须是url类型'
    ];

    //验证场景
    protected $scene = [
        'getList' => ['page_no', 'page_size'],
        'edit' => ['cover'],
        'getInfo' => ['id'],
        'delete' => ['ids'],
        'sort' => [''],
    ];

}